#!/bin/bash
#监控从redis的状态，正常显示1，否则显示0
ip=192.168.152.12
port=6381
redis-cli -h $ip -p $port info replication | grep "master_link_status:up" &> /dev/null

if [ $? -eq 0 ];then
        echo "1"
  else
        echo "0"
fi


